document.onreadystatechange = function()
{    
    if(document.readyState=="complete")
    {
        var twelvecheck = System.Gadget.Settings.read("twelve");
        twelve.checked = twelvecheck;    
    }        
}

System.Gadget.onSettingsClosing = function(event)
{
    if (event.closeAction == event.Action.commit)
    {
        var twelvecheck = twelve.checked;
        System.Gadget.Settings.write("twelve", twelvecheck);
        event.cancel = false;
    }
}